package org.apache.harmony.javax.security.auth.callback;

import java.io.Serializable;

public class ConfirmationCallback
  implements Serializable, Callback
{
  private static final long serialVersionUID = -9095656433782481624L;
  public static final int YES = 0;
  public static final int NO = 1;
  public static final int CANCEL = 2;
  public static final int OK = 3;
  public static final int YES_NO_OPTION = 0;
  public static final int YES_NO_CANCEL_OPTION = 1;
  public static final int OK_CANCEL_OPTION = 2;
  public static final int UNSPECIFIED_OPTION = -1;
  public static final int INFORMATION = 0;
  public static final int WARNING = 1;
  public static final int ERROR = 2;
  private String prompt;
  private int messageType;
  private int optionType = -1;
  private int defaultOption;
  private String[] options;
  private int selection;

  public ConfirmationCallback(int paramInt1, int paramInt2, int paramInt3)
  {
    if ((paramInt1 > 2) || (paramInt1 < 0))
      throw new IllegalArgumentException("auth.16");
    switch (paramInt2)
    {
    case 0:
      if ((paramInt3 != 0) && (paramInt3 != 1))
        throw new IllegalArgumentException("auth.17");
      break;
    case 1:
      if ((paramInt3 != 0) && (paramInt3 != 1) && (paramInt3 != 2))
        throw new IllegalArgumentException("auth.17");
      break;
    case 2:
      if ((paramInt3 != 3) && (paramInt3 != 2))
        throw new IllegalArgumentException("auth.17");
      break;
    default:
      throw new IllegalArgumentException("auth.18");
    }
    this.messageType = paramInt1;
    this.optionType = paramInt2;
    this.defaultOption = paramInt3;
  }

  public ConfirmationCallback(int paramInt1, String[] paramArrayOfString, int paramInt2)
  {
    if ((paramInt1 > 2) || (paramInt1 < 0))
      throw new IllegalArgumentException("auth.16");
    if ((paramArrayOfString == null) || (paramArrayOfString.length == 0))
      throw new IllegalArgumentException("auth.1A");
    for (int i = 0; i < paramArrayOfString.length; i++)
      if ((paramArrayOfString[i] == null) || (paramArrayOfString[i].length() == 0))
        throw new IllegalArgumentException("auth.1A");
    if ((paramInt2 < 0) || (paramInt2 >= paramArrayOfString.length))
      throw new IllegalArgumentException("auth.17");
    this.options = paramArrayOfString;
    this.defaultOption = paramInt2;
    this.messageType = paramInt1;
  }

  public ConfirmationCallback(String paramString, int paramInt1, int paramInt2, int paramInt3)
  {
    if ((paramString == null) || (paramString.length() == 0))
      throw new IllegalArgumentException("auth.14");
    if ((paramInt1 > 2) || (paramInt1 < 0))
      throw new IllegalArgumentException("auth.16");
    switch (paramInt2)
    {
    case 0:
      if ((paramInt3 != 0) && (paramInt3 != 1))
        throw new IllegalArgumentException("auth.17");
      break;
    case 1:
      if ((paramInt3 != 0) && (paramInt3 != 1) && (paramInt3 != 2))
        throw new IllegalArgumentException("auth.17");
      break;
    case 2:
      if ((paramInt3 != 3) && (paramInt3 != 2))
        throw new IllegalArgumentException("auth.17");
      break;
    default:
      throw new IllegalArgumentException("auth.18");
    }
    this.prompt = paramString;
    this.messageType = paramInt1;
    this.optionType = paramInt2;
    this.defaultOption = paramInt3;
  }

  public ConfirmationCallback(String paramString, int paramInt1, String[] paramArrayOfString, int paramInt2)
  {
    if ((paramString == null) || (paramString.length() == 0))
      throw new IllegalArgumentException("auth.14");
    if ((paramInt1 > 2) || (paramInt1 < 0))
      throw new IllegalArgumentException("auth.16");
    if ((paramArrayOfString == null) || (paramArrayOfString.length == 0))
      throw new IllegalArgumentException("auth.1A");
    for (int i = 0; i < paramArrayOfString.length; i++)
      if ((paramArrayOfString[i] == null) || (paramArrayOfString[i].length() == 0))
        throw new IllegalArgumentException("auth.1A");
    if ((paramInt2 < 0) || (paramInt2 >= paramArrayOfString.length))
      throw new IllegalArgumentException("auth.17");
    this.options = paramArrayOfString;
    this.defaultOption = paramInt2;
    this.messageType = paramInt1;
    this.prompt = paramString;
  }

  public String getPrompt()
  {
    return this.prompt;
  }

  public int getMessageType()
  {
    return this.messageType;
  }

  public int getDefaultOption()
  {
    return this.defaultOption;
  }

  public String[] getOptions()
  {
    return this.options;
  }

  public int getOptionType()
  {
    return this.optionType;
  }

  public int getSelectedIndex()
  {
    return this.selection;
  }

  public void setSelectedIndex(int paramInt)
  {
    if (this.options != null)
    {
      if ((paramInt >= 0) && (paramInt <= this.options.length))
        this.selection = paramInt;
      else
        throw new ArrayIndexOutOfBoundsException("auth.1B");
    }
    else
    {
      switch (this.optionType)
      {
      case 0:
        if ((paramInt != 0) && (paramInt != 1))
          throw new IllegalArgumentException("auth.19");
        break;
      case 1:
        if ((paramInt != 0) && (paramInt != 1) && (paramInt != 2))
          throw new IllegalArgumentException("auth.19");
        break;
      case 2:
        if ((paramInt != 3) && (paramInt != 2))
          throw new IllegalArgumentException("auth.19");
        break;
      }
      this.selection = paramInt;
    }
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     org.apache.harmony.javax.security.auth.callback.ConfirmationCallback
 * JD-Core Version:    0.6.1
 */